<template>
  <div>
    <div class="row">
      <div class="col-xs-offset-2 col-xs-8">
        <div class="page-header"><h2>Router Basic - 01</h2></div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-2 col-xs-offset-2">
        <div class="list-group">
          <!--声明式导航-->
          <router-link class="list-group-item" to="/about">About</router-link>
          <router-link class="list-group-item" to="/home">Home</router-link>
          <router-link class="list-group-item" to="/user">User</router-link>

          <!--编程式导航-->
          <!--<a href="javascript:;" class="list-group-item" @click="toAbout">About</a>
          <a href="javascript:;" class="list-group-item" @click="toHome">Home</a>
          <a href="javascript:;" class="list-group-item" @click="toUser">User</a>-->
        </div>
      </div>
      <div class="col-xs-6">
        <div data-v-957c9522="" class="col-xs-6">
          <div data-v-957c9522="" class="panel">
            <div data-v-957c9522="" class="panel-body">
              <router-view></router-view>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'App',
    data(){return{a:"afromdata",b:"bfromdata"}},
    methods:{
      //toAbout(){this.$router.push(`/about?a=${this.a}&b=${this.b}#123`)},
      /*toAbout(){
        const {a,b} = this;
        this.$router.push({
          path:"/about",
          query:{a,b},
          hash:"#123"
        })
      },*/
      toAbout(){
        this.$router.push({
          name:"about"
        })
      },
      toHome(){this.$router.push("/home")},
      toUser(){this.$router.push("/user")},
    }
  }
</script>

<style scoped>
  #app{
    text-align: center;
  }
</style>
